package cn.lizemin.command.origin.entity;

/**
 * @author lzm
 * @version 1.0
 * @description: 开关类
 * @date 2022/5/12 9:44
 */
public class Switcher {

    private Bulb bulb;

//    每个开关必须要能够控制一个灯泡
    public Switcher(Bulb bulb) {
        this.bulb = bulb;
    }

    //按钮触发
    public void buttonPush() {
        System.out.println("按下按钮...");
        bulb.on();
    }

    //按钮触发
    public void buttonPop() {
        System.out.println("弹起按钮...");
        bulb.off();
    }

}
